
import proFetch from '../../../../hrpub/common/utils/project-fetch';
import moment from 'moment';

export default {
    name: 'emp',
    data: {
        orgValue: null, // 人力资源组织
        widget:false,
        language: {}, // 多语
        context: {}, // 上下文
        pageInfo: {
            pageIndex: 1,
            pageSize: 10,
            total: 0,
            totalPage: 1
        }, // 主页面表格的分页信息
        orderStatus: ['-1', '3'], // 订单状态
        orderTimeRange: 'oneWeek', // 订单时间范围
        orderBeginTime: '', // 订单开始时间
        orderEndTime: '', // 订单结束时间
        page: '', // 当前页面， main主页面，add新增页面，edit修改页面
        tableSelectAll: false, // 是否选中了全部表格
        addPageStatus: 'edit', // 新增页面的状态，edit编辑态，browse浏览态
        offerContentModalVisible: false, // 发送offer弹窗的显示隐藏
        offerModalContent: '', // offer弹窗里的内容字符串
        orgSituationModalVisible: false, // 编制情况弹窗的显示隐藏
        orgStaActiveTab: 'org', // 编制情况的t当前tab
        orgStaOptions: [], // 编制情况里的下拉框内容
        orgStaOrgData: [], // 编制情况的组织编制表格数据
        orgStaDeptData: [], // 编制情况的部门情况表格数据
        orgStaOrgDimension: '', // 编制情况的编制维度
        batchAddModalVisible: false, // 批量新增的弹窗显示隐藏
        batchAddCurrentStep: 0, // 批量新增弹窗当前步骤
        fileManagerModalVisible: false, // 福建管理弹显示显示隐藏
        fileManagerBillId: '', // 传递给福建管理的id
        fromApprove: false, // 是否来自于审批中心的打开
        approveBillType: '', // 审批详情弹窗的billType
        approveBillId: '', // 审批详情弹窗的billId
        approveModalVisible: false, // 审批详情弹窗的显示和隐藏
        leaveType: null, // 离职业务类型
        viewContractModalVisible: false, // 查看合同弹窗显示/隐藏
        viewContractTableInfo: [], // 查看合同表格信息
        viewContractTableData: [], // 查看合同表格数据
        showOrgRefer: false, // 是否显示组织参照
        headerComponentWidth: '160px', // 头部的异动类型状态时间段的控件宽度
        compositedisplay: false, //是否显示 指派弹窗
        compositedata: null, //指派弹窗 数据
        compositepostdata: null ,//指派弹窗确定时传到后台的数据,
        pageHeight: 0, // 页面高度， 供之后使用
        addPageHistoryData: null, // 卡片页面编辑前数据
        hasSearched: false, // 是否进行过一次搜索
        buttons: [], // 暂存下都有啥按钮
        initValue: {}, // 模版自带的初始化值
        excuteVisible: false, // 执行弹窗的显示
        effectDate:'', // 执行日期,
        selectedRows: [],
        pageid: '', // 模板的pageid
        batchAddPageId: '', // 批量模板的pageid
        // isApprFlow: true, // true为审批流。false为工作流
        isApprove: null
    },
    sync: {
        update(state, payload) {
            return {
                ...state,
                ...payload
            };
        }
    },
    async: {
        //  // 校验是审批流还是工作流
        //  checkIsApprFlow(dispatch, getState, payload) {
        //     return proFetch({
        //         url: '/nccloud/hrtrn/pub/CheckIsApprFlowAction.do',
        //         body: payload.postData
        //     })
        // },

        // 获取主页面表格数据
        getMainTableData(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionQueryBillAction.do',
                body: payload.postData
            });
        },
        // 跳转到新增页面前进行验证
        checkToAddPage(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionAddAction.do',
                body: payload.postData
            });
        },
        // 新增页面编辑前
        formEditBefore(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionBeforeEditAction.do',
                body: payload.postData
            });
        },
        // 删除表格行们
        deleteTableRows(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionDeleteAction.do',
                body: payload.postData
            });
        },
        // 新增表单编辑后
        formEditAfter(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionAfterEditAction.do',
                body: payload.postData
            });
        },
        // 新增保存前检测
        checkAddPageSave(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionSaveCheckAction.do',
                body: payload.postData
            });
        },
        // 新增保存
        addPageSave(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionSaveAction.do',
                body: payload.postData
            });
        },
        // 提交单据
        submitBill(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionCommitAction.do',
                body: payload.postData
            });
        },
        // 收回单据
        callbackBill(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionCallbackAction.do',
                body: payload.postData
            });
        },
        // 执行单据
        excuteBill(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionExcuteAction.do',
                body: payload.postData
            });
        },

        // 修改单据
        editBill(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionEditAction.do',
                body: payload.postData
            });
        },
        // 获取一条数据
        getOneBillData(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionQueryOneAction.do',
                body: payload.postData
            });
        },
        // 复制一条数据
        copyOneBill(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/entrymng/EntryCopyAction.do',
                body: payload.postData
            });
        },
        // 获取发送offer弹窗内容
        getOfferModalContent(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/entrymng/EntryGetOfferContentAction.do',
                body: payload.postData
            });
        },
        // 发送offer
        sendOffer(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/entrymng/EntrySendOfferAction.do',
                body: payload.postData
            });
        },
        // 接受offer
        acceptOffer(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/entrymng/EntryAcceptOfferAction.do',
                body: payload.postData
            });
        },
        // 拒绝offer
        rejectOffer(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/entrymng/EntryRejectOfferAction.do',
                body: payload.postData
            });
        },
        // 提交offer
        submitOffer(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/entrymng/EntryCommitOfferAction.do',
                body: payload.postData
            });
        },
        // 编制情况打开弹窗获取初始化数据
        getOrgSituationInitData(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/entrymng/EntryCheckBudgetAction.do',
                body: payload.postData
            });
        },
        // 批量新增页面根据参照选择获取表格数据
        getBatchAddTableDataByRefer(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionBatchAddSelPsnAction.do',
                body: payload.postData
            });
        },
        // 批量新增页面根据查询条件获取表格数据
        getBatchAddTableDataBySearch(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionBatchAddQryPsnAction.do',
                body: payload.postData
            });
        },
        // 批量添加页面第二步表单编辑前
        batchAddModalFormEditBefore(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/entrymng/EntryBatchAddBeforeEditAction.do',
                body: payload.postData
            });
        },
        // 批量添加页面第二步表单编辑后
        batchAddModalFormEditAfter(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/entrymng/EntryBatchAddAfterEditAction.do',
                body: payload.postData
            });
        },
        // 批量添加页面点击完成
        batchAddModalSubmit(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionBatchAddSaveAction.do',
                body: payload.postData
            });
        },
        // 批量新增保存前椒盐
        batchAddModalSubmitChecked(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionBatchAddSaveCheckAction.do',
                body: payload.postData
            });
        },
        // 联查人员卡片
        jointPsnCard(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrhi/psndoc/PsndocCardReptQueryAction.do',
                body: payload.postData
            });
        },
        // 获取查看合同数据
        getViewContractData(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionCheckCtrtAction.do',
                body: payload.postData
            });
        },
        // 初始化批量新增弹窗
        initBatchAddModal(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionBatchAddInitAction.do',
                body: payload.postData
            });
        },
        // 批量新增弹窗下一步
        batchAddNextStep(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionBatchAddNextStepAction.do',
                body: payload.postData
            });
        },
        // 新增取消
        cancelAdd(dispatch, getState, payload) {
            return proFetch({
                url: '/nccloud/hrtrn/dimissionmng/DimissionCancelAction.do',
                body: payload.postData
            });
        },
        //小部件跳转接口
        getWidgetTableData(dispatch,getState,payload){
            return proFetch({
                url: '/nccloud/hrtrn/widgets/ListData.do',
                body: payload.postData
            })
        }
    }
};